package com.boot.project.controller;


import com.boot.project.domain.OrderDo;
import com.boot.project.domain.SpaceDO;
import com.boot.project.service.SpaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/space")
@RestController
public class SpaceComtroller {
    @Autowired
    private SpaceService spaceService;

    //查询所有场地详情
    @GetMapping("/listAllSpace")
    public List<SpaceDO> listAllSpace(){
        return spaceService.list();
    }

    @PostMapping("/update")
    public int update(@RequestBody SpaceDO spaceDo){
        return spaceService.update(spaceDo);
    }

    @PostMapping("/add")
    public int add(@RequestBody  SpaceDO spaceDo){
        return spaceService.add(spaceDo);
    }
}
